package pl.edu.agh.inpema;

import java.util.List;

import org.apache.log4j.Logger;
import org.apache.log4j.xml.DOMConfigurator;

import pl.edu.agh.inpema.core.environment.EnvironmentExplorer;
import pl.edu.agh.inpema.core.environment.EnvironmentInfo;

public class GetAllEnvironments {
	
	private static final String LOGGER_PROP_FILE = "resources/logger.properties.xml";

	public static void main(String[] args) {
		
		DOMConfigurator.configure(LOGGER_PROP_FILE);
		Logger logger = Logger.getLogger(PerformGatherAndAnalyze.class);
		
		EnvironmentExplorer explorer = new EnvironmentExplorer();
		try {
			explorer.startConection();
			List<EnvironmentInfo> environmentsList = explorer.getAllEnvironmentsInfo();
			for (EnvironmentInfo envInfo : environmentsList) {
				System.out.println(envInfo);
			}
		} finally {
			explorer.closeConnection();
		}
		
	}
	
}
